package research.ui.editors.tableeditors.formula;

import org.eclipse.jface.viewers.Viewer;

import research.domain.ComponentValue;
import research.ui.editors.tableeditors.EntitySorter;

public class FormulaSorter extends EntitySorter {

	@Override
	public int compare(Viewer viewer, Object o1, Object o2) {
		ComponentValue for1 = (ComponentValue) o1;
		ComponentValue for2 = (ComponentValue) o2;
		
		if (for1.isIs_main())
			return for2.isIs_main() ? 0 : -1;
		else if (for2.isIs_main())
			return 1;
		else 
			return super.compare(viewer, o1, o2);
	}
	
}
